package obj;

import org.newdawn.slick.Animation;
import org.newdawn.slick.SlickException;

import play.Things;

/**
 * Moving enemy class.
 * @author VincentLy
 */
public class MovingEnemy extends Enemy{
	
	public MovingEnemy(float x,float y,int d,Animation a) throws SlickException{
		super(x,y,d,a);
	}
	
	/**
	 * Moves toward the player horizontally.
	 * @author VincentLy
	 */
	public void update(){
		super.update();
		if(!isHit())
			setXVel(-10*Integer.signum((int) (x()-Things.player.x())));	
	}
}